//
//  AppNetConnect.m
//  GCD
//
//  Created by Bindx on 5/22/14.
//  Copyright (c) 2014 tianya2416. All rights reserved.
//

#import "AppNetConnect.h"

@implementation AppNetConnect


+(AppNetConnect*)connectshared
{
    static AppNetConnect *connectshared;
    static dispatch_once_t oneToken;
    dispatch_once(&oneToken, ^{
        connectshared = [[self alloc]init];
    });
    return connectshared;
}

- (instancetype)init
{
    self = [super init];
    if (self) {
//        <#statements#>
    }
    return self;
}


-(void)getRequest:(NSString *)_url withDelegate:(id)delegate
{
    AFHTTPRequestOperationManager * manger = [AFHTTPRequestOperationManager manager];
//    manger.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"];
    [manger GET:_url parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
        if ([delegate respondsToSelector:@selector(downloadFinish:)]) {
            [delegate downloadFinish:responseObject];
        }
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        NSLog(@"%@",error);
    }];
}













@end
